#include <algorithm>
#include <deque>
#include <iostream>
#include <istream>
#include <limits>
#include <string>
using ll = long long;

ll n,p,q,x,y,ans=std::numeric_limits<ll>::max();
std::string s;

int main(){
    std::iostream::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::cin>>n>>p>>q>>x>>y;
    std::cin>>s;
    for(ll msk=0;msk<(1ll<<n);msk++){
        std::string ns = s;
        ll nans{};
        for(ll i=0;i<ns.size();i++){
            if((1ll<<i)&msk){
                if(ns[i]=='+'){
                    ns[i]='-';
                }else{
                    ns[i]='+';
                }
                nans+=x;
            }
        }
        std::deque dq(ns.begin(),ns.end());
        for(ll i=0;i<n;i++){
            ll now{p};
            for(auto it = dq.begin();it!=dq.end();it++){
                if((*it)=='+'){
                    now++;
                }else{
                    if(now==0){
                        goto next;
                    }
                    now--;
                }
            }
            if(now==q){
                ans=std::min(ans,nans);
            }
            next:;
            auto eit = --dq.end();
            char ec = *eit;
            dq.erase(eit);
            dq.push_front(ec);
            nans+=y;
        }
    }
    std::cout<<ans<<'\n';
}